|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<T>
ga.core.individual.IndividualList<T>
T
- The generic type of individuals.public class IndividualList<T extends IIndividual<T>>
ArrayList
for individuals. Adds sorting and validation functions.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
IndividualList()
Creates a new list. |
|
IndividualList(java.util.Collection<? extends T> c)
Creates a new list by copying the given collection. |
Method Summary | |
---|---|
boolean |
isValid(IValidator<T> validator,
GAContext context)
Validates the list with a given validator. |
void |
sort(boolean descending)
Sorts the list by using IndividualComparator . |
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public IndividualList()
public IndividualList(java.util.Collection<? extends T> c)
c
- Collection to copy.Method Detail |
---|
public void sort(boolean descending)
IndividualComparator
.
descending
- Sort descending if true
, ascending otherwise.public boolean isValid(IValidator<T> validator, GAContext context)
validator
- The validator to use, nothing will happen if it is
null
.context
- The GA context.
true
if all the individuals in the list are valid.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |